Pick up fit locations test case (#766)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Fri, 19 Nov 2021 13:48:53 +0000 (06:48 -0700)
committerGitHub <noreply@github.com>
Fri, 19 Nov 2021 13:48:53 +0000 (06:48 -0700)
* Add support for Locations.fit files

* patch by tsteven4 to address review comments

* Add a test case for Locations.fit files from Garmin devices

Co-authored-by: Fabrizio Gennari <fabrizio.ge@tiscali.it>
reference/track/fitlocations-sample.fit [new file with mode: 0644]
reference/track/fitlocations-sample.gpx [new file with mode: 0644]
testo.d/garmin_fit.test

diff --git a/reference/track/fitlocations-sample.fit b/reference/track/fitlocations-sample.fit
new file mode 100644 (file)
index 0000000..1ab42e2
Binary files /dev/null and b/reference/track/fitlocations-sample.fit differ
diff --git a/reference/track/fitlocations-sample.gpx b/reference/track/fitlocations-sample.gpx
new file mode 100644 (file)
index 0000000..9aac3f2
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gpx version="1.0" creator="GPSBabel - https://www.gpsbabel.org" xmlns="http://www.topografix.com/GPX/1/0">
+  <time>1970-01-01T00:00:00Z</time>
+  <bounds minlat="40.321111679" minlon="5.179891856" maxlat="52.178867133" maxlon="9.332499504"/>
+  <wpt lat="52.178867133" lon="5.179891856">
+    <name>Posizione 008</name>
+    <cmt>Posizione 008</cmt>
+    <desc>Posizione 008</desc>
+  </wpt>
+  <wpt lat="40.321111679" lon="9.332499504">
+    <ele>531.200</ele>
+    <name>Via Sebastiano </name>
+    <cmt>Some random position in the centre of a small tow</cmt>
+    <desc>Some random position in the centre of a small tow</desc>
+  </wpt>
+  <trk/>
+</gpx>
index a2a5a71da9cb887635b4a67853406da6d5eea76a..559f09e0164d7880d49bb6466a38b477b2e9bba1 100644 (file)
@@ -29,6 +29,10 @@ compare ${REFERENCE}/track/garmin-oregon-700-output.gpx ${TMPDIR}/fit-sample-gar
 gpsbabel -i garmin_fit,recoverymode -f ${REFERENCE}/track/lezyne_super_gps-garmin_fit-sample-bad-endian.fit -o gpx -F ${TMPDIR}/lezyne_super_gps-garmin_fit-sample-bad-endian.gpx 2>/dev/null
 compare ${REFERENCE}/track/lezyne_super_gps-garmin_fit-sample-bad-endian.gpx ${TMPDIR}/lezyne_super_gps-garmin_fit-sample-bad-endian.gpx
 
+# fitlocations-sample.fit is from a Garmin Edge Explore, edited to remove sensitive data.
+gpsbabel -i garmin_fit -f ${REFERENCE}/track/fitlocations-sample.fit -o gpx -F ${TMPDIR}/fitlocations-sample.gpx
+compare ${REFERENCE}/track/fitlocations-sample.gpx ${TMPDIR}/fitlocations-sample.gpx
+
 gpsbabel -i garmin_fit -f ${REFERENCE}/Lctns_Instinct.fit -o unicsv,utc=0 -F ${TMPDIR}/Lctns_Instinct.csv
 compare ${REFERENCE}/Lctns_Instinct.csv ${TMPDIR}/Lctns_Instinct.csv